home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / glibmm-2.4 / glibmm / optionentry.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  3.1 KB  |  113 lines

  1. // -*- c++ -*-
  2. // Generated by gtkmmproc -- DO NOT MODIFY!
  3. #ifndef _GLIBMM_OPTIONENTRY_H
  4. #define _GLIBMM_OPTIONENTRY_H
  5.  
  6.  
  7. /* $Id: optionentry.hg,v 1.11 2005/07/31 13:11:05 murrayc Exp $ */
  8.  
  9. /* Copyright (C) 2004 The glibmm Development Team
  10.  *
  11.  * This library is free software; you can redistribute it and/or
  12.  * modify it under the terms of the GNU Library General Public
  13.  * License as published by the Free Software Foundation; either
  14.  * version 2 of the License, or (at your option) any later version.
  15.  *
  16.  * This library is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  19.  * Library General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU Library General Public
  22.  * License along with this library; if not, write to the Free
  23.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  */
  25.  
  26.  
  27. #include <glibmm/ustring.h>
  28.  
  29. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  30. extern "C" { typedef struct _GOptionEntry GOptionEntry; }
  31. #endif
  32.  
  33.  
  34. namespace Glib
  35. {
  36.  
  37. /** An OptionEntry defines a single option. To have an effect, it must be added to an OptionGroup with 
  38.  * OptionGroup::add_entry().
  39.  * 
  40.  * The long name of an option can be used to specify it in a commandline as --long_name. 
  41.  * Every option must have a long name. To resolve conflicts if multiple option groups contain the same long name, it is also 
  42.  * possible to specify the option as --groupname-long_name.
  43.  *
  44.  * If an option has a short name, it can be specified as -short_name in a commandline.
  45.  *
  46.  * The description for the option is shown in the --help  output.
  47.  *
  48.  * The arg_descripton is the placeholder to use for the extra argument parsed by the option in --help  output. 
  49.  */
  50. class OptionEntry
  51. {
  52.   public:
  53. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  54.   typedef OptionEntry CppObjectType;
  55.   typedef GOptionEntry BaseObjectType;
  56. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  57.  
  58. private:
  59.  
  60. public:
  61.  
  62.   //Copied from goption.h, instead of generated, so that we can put it inside the class.
  63.   enum Flags
  64.   {
  65.     FLAG_HIDDEN = 1 << 0,
  66.     FLAG_IN_MAIN = 1 << 1,
  67.     FLAG_REVERSE = 1 << 2,
  68.     FLAG_NO_ARG = 1 << 3,
  69.     FLAG_FILENAME = 1 << 4,
  70.     FLAG_OPTIONAL_ARG = 1 << 5,
  71.     FLAG_NOALIAS = 1 << 6
  72.   } GOptionFlags;
  73.  
  74.   OptionEntry();
  75.   OptionEntry(const OptionEntry& src);
  76.   virtual ~OptionEntry();
  77.   
  78.   OptionEntry& operator=(const OptionEntry& src);
  79.  
  80.  
  81.   Glib::ustring get_long_name() const;
  82.   void set_long_name(const Glib::ustring& value);
  83.   
  84.   gchar get_short_name() const;
  85.   void set_short_name(const gchar& value);
  86.   
  87.   int get_flags() const;
  88.   void set_flags(const int& value);
  89.   
  90.   //TODO: G_OPTION_ARG_CALLBACK,
  91.     
  92.   Glib::ustring get_description() const;
  93.   void set_description(const Glib::ustring& value);
  94.   
  95.   Glib::ustring get_arg_description() const;
  96.   void set_arg_description(const Glib::ustring& value);
  97.   
  98.   GOptionEntry*       gobj()       { return gobject_; }
  99.   const GOptionEntry* gobj() const { return gobject_; }
  100.   
  101. protected:
  102.  
  103.   GOptionEntry* gobject_;
  104.  
  105.  
  106. };
  107.  
  108. } // namespace Glib
  109.  
  110.  
  111. #endif /* _GLIBMM_OPTIONENTRY_H */
  112.  
  113.